package node.java;

import utils.titles.Title;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by thormentor on 27-04-2014.
 */
public class JavaPackage {
    private final Map<String, JavaClass> classes = new LinkedHashMap<>();

    private String name;

    public JavaPackage(String name) {
        this.name = name;
    }

    public JavaClass getClass(String name) {
        if (!classes.containsKey(name))
            classes.put(name, new JavaClass(Title.fromPascalCase(name)));

        return classes.get(name);
    }

    @Override
    public String toString() {
        return name;
    }

    public String getName() {
        return name;
    }
}
